package cn.kmsoft.stgeometry.util;



import cn.kmsoft.common.utils.StringUtil;

import java.io.Serializable;


/**
 * 坐标投影转换器
 * 
 * @author wangq
 *
 */
public class TxtCrsTransfor implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String crsType;//坐标系类型
	private String degreeNo;//分带号，3度分带或者6度分带
	private String projectionType;//投影坐标
	private String degreeNum;//带号
	private String wkid;//epsg代码
	private Integer wkidEpsg;//数字类型
	private String crsName;//详细的英文名称
	
	
	public String getCrsType() {
		return crsType;
	}
	public void setCrsType(String crsType) {
		this.crsType = crsType;
	}
	
	public String getCrsName() {
		return crsName;
	}
	public void setCrsName(String crsName) {
		this.crsName = crsName;
	}
	
	public String getDegreeNo() {
		return degreeNo;
	}
	public void setDegreeNo(String degreeNo) {
		this.degreeNo = degreeNo;
	}
	
	public String getProjectionType() {
		return projectionType;
	}
	public void setProjectionType(String projectionType) {
		this.projectionType = projectionType;
	}
	
	public String getDegreeNum() {
		return degreeNum;
	}
	public void setDegreeNum(String degreeNum) {
		this.degreeNum = degreeNum;
	}
	
	public Integer getWkidEpsg() {
		return wkidEpsg;
	}
	public void setWkidEpsg(Integer wkidEpsg) {
		this.wkidEpsg = wkidEpsg;
	}
	
	
	public String getWkid() {
		if(StringUtil.isNullOrEmpty(wkid)) {
			if ("2000国家大地坐标系".equalsIgnoreCase(crsType)) {
				if ("3".equalsIgnoreCase(this.degreeNo)) {
					switch (this.degreeNum) {
						case "35":
							wkid = "4523";
							wkidEpsg= 4523;
							break;
						case "36":
							wkid = "4524";
							wkidEpsg= 4524;
							break;
						case "37":
							wkid = "4525";
							wkidEpsg= 4525;
							break;
						default:
							wkid = "4496";
							wkidEpsg= 4496;
							break;
					}
				}
			} else if ("80国家大地坐标系".equalsIgnoreCase(crsType)) {
				if ("3".equalsIgnoreCase(this.degreeNo)) {
					switch (this.degreeNum) {
						case "35":
							wkid = "2359";
							wkidEpsg= 2359;
							break;
						case "36":
							wkid = "2360";
							wkidEpsg= 2360;
							break;
						case "37":
							wkid = "2361";
							wkidEpsg= 2361;
							break;
						default:
							wkid = "2332";
							wkidEpsg= 2332;
							break;
					}
				}
			} else if ("CQDULI".equalsIgnoreCase(crsType)) {
				wkid="CQDULI";
			}
		}
		
		return wkid;
		
	}
	public void setWkid(String wkid) {
		this.wkid = wkid;
	}
	
	
}
